package com.zd.controller;/**
 * @Description: TransportoutsourcingController
 * @Author:pioneer
 * @Date: 2021-07-27
 * @Version:v1.0
 */

import com.zd.service.lnter.TransportoutsourcingServicelnter;
import com.zzg.entity.Departurelist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: TransportoutsourcingController 运输外包控制器
 * @Author:pioneer
 * @Date: 2021-07-27
 * @Version:v1.0
 */
@Controller
public class TransportoutsourcingController {
    @Autowired
    private TransportoutsourcingServicelnter transportoutsourcingServicelnter;

    @RequestMapping("querytransport")
    @ResponseBody
    public Map<String,Object> querytransport(int page, int limit){
        System.out.println ("querytransport进：page"+page+"\tlimit"+limit);
        Map<String,Object> map = new HashMap<> ();
        map.put("code","");
        map.put("msg","");
        map.put("count",transportoutsourcingServicelnter.selectTransportoutsourcinglist ().size ());
        map.put("data",transportoutsourcingServicelnter.pagingqueryTransportoutsourcinglist (page,limit));
        System.out.println (map);
        return map;
    }

    /**
     * 动态条件查询所有其它外包信息
     * @param departurelist
     * @return
     */
    @RequestMapping("conditionalquerytransport")
    @ResponseBody
    public Map<String,Object> conditionalquerytransport(Departurelist departurelist){
        int page=1;
        int limit=10;
        Map<String,Object> map = new HashMap<> ();
        map.put("code","");
        map.put("msg","");
        map.put("count",transportoutsourcingServicelnter.getTransportoutsourcingcondition (departurelist));
        map.put("data",transportoutsourcingServicelnter.conditionqueryTransportoutsourcinglist (departurelist,page,limit));
        System.out.println (map);
        return map;
    }
}
